{
 "cells": [
  {
   "cell_type": "code",
   "execution_count": 1,
   "metadata": {
    "ExecuteTime": {
     "end_time": "2024-04-11T20:58:42.863380Z",
     "start_time": "2024-04-11T20:58:42.859783Z"
    }
   },
   "outputs": [],
   "source": [
    "import pixeltable as pxt\n",
    "from pixeltable.iterators.document import DocumentSplitter"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 2,
   "metadata": {
    "ExecuteTime": {
     "end_time": "2024-04-11T20:58:42.867255Z",
     "start_time": "2024-04-11T20:58:42.865054Z"
    }
   },
   "outputs": [],
   "source": [
    "pdf_path = f'{pxt.__path__[0]}/tests/data/documents/layout-parser-paper.pdf'"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 11,
   "metadata": {},
   "outputs": [],
   "source": [
    "example_tuples = []\n",
    "for i, tup in enumerate(DocumentSplitter(pdf_path, separators='paragraph', metadata='page, bounding_box')):\n",
    "    example_tuples.append(tup)\n",
    "    if i == 4:\n",
    "        break"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 12,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "[{'text': 'LayoutParser: A Unified Toolkit for Deep\\nLearning Based Document Image Analysis\\n',\n",
       "  'page': 0,\n",
       "  'bounding_box': {'x1': 157.6219940185547,\n",
       "   'y1': 115.03832244873047,\n",
       "   'x2': 457.8017883300781,\n",
       "   'y2': 147.33184814453125}},\n",
       " {'text': 'Zejiang Shen1 (), Ruochen Zhang2, Melissa Dell3, Benjamin Charles Germain\\nLee4, Jacob Carlson3, and Weining Li5\\n',\n",
       "  'page': 0,\n",
       "  'bounding_box': {'x1': 134.8090057373047,\n",
       "   'y1': 167.27603149414062,\n",
       "   'x2': 480.54638671875,\n",
       "   'y2': 192.8096160888672}},\n",
       " {'text': '1 Allen Institute for AI\\nshannons@allenai.org\\n2 Brown University\\nruochen zhang@brown.edu\\n3 Harvard University\\n{melissadell,jacob carlson}@fas.harvard.edu\\n4 University of Washington\\nbcgl@cs.washington.edu\\n5 University of Waterloo\\nw422li@uwaterloo.ca\\n',\n",
       "  'page': 0,\n",
       "  'bounding_box': {'x1': 207.23001098632812,\n",
       "   'y1': 200.6651611328125,\n",
       "   'x2': 408.1268615722656,\n",
       "   'y2': 312.072998046875}},\n",
       " {'text': 'Abstract. Recent advances in document image analysis (DIA) have been\\nprimarily driven by the application of neural networks. Ideally, research\\noutcomes could be easily deployed in production and extended for further\\ninvestigation. However, various factors like loosely organized codebases\\nand sophisticated model configurations complicate the easy reuse of im-\\nportant innovations by a wide audience. Though there have been on-going\\nefforts to improve reusability and simplify deep learning (DL) model\\ndevelopment in disciplines like natural language processing and computer\\nvision, none of them are optimized for challenges in the domain of DIA.\\nThis represents a major gap in the existing toolkit, as DIA is central to\\nacademic research across a wide range of disciplines in the social sciences\\nand humanities. This paper introduces LayoutParser, an open-source\\nlibrary for streamlining the usage of DL in DIA research and applica-\\ntions. The core LayoutParser library comes with a set of simple and\\nintuitive interfaces for applying and customizing DL models for layout de-\\ntection, character recognition, and many other document processing tasks.\\nTo promote extensibility, LayoutParser also incorporates a community\\nplatform for sharing both pre-trained models and full document digiti-\\nzation pipelines. We demonstrate that LayoutParser is helpful for both\\nlightweight and large-scale digitization pipelines in real-word use cases.\\nThe library is publicly available at https://layout-parser.github.io.\\n',\n",
       "  'page': 0,\n",
       "  'bounding_box': {'x1': 162.7790069580078,\n",
       "   'y1': 338.9521789550781,\n",
       "   'x2': 454.092529296875,\n",
       "   'y2': 567.0989990234375}},\n",
       " {'text': 'Keywords: Document Image Analysis · Deep Learning · Layout Analysis\\n· Character Recognition · Open Source library · Toolkit.\\n',\n",
       "  'page': 0,\n",
       "  'bounding_box': {'x1': 162.3459930419922,\n",
       "   'y1': 577.9205322265625,\n",
       "   'x2': 452.2435302734375,\n",
       "   'y2': 600.168212890625}}]"
      ]
     },
     "execution_count": 12,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "example_tuples"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 13,
   "metadata": {
    "ExecuteTime": {
     "end_time": "2024-04-11T20:58:43.144688Z",
     "start_time": "2024-04-11T20:58:42.912418Z"
    }
   },
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "Created table `pdf_table`.\n",
      "Inserting rows into `pdf_table`: 1 rows [00:00, 1069.70 rows/s]"
     ]
    },
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "\n",
      "Inserted 1 row with 0 errors.\n",
      "Inserting rows into `pdf_paragraphs`: 153 rows [00:00, 15016.46 rows/s]\n",
      "Created view `pdf_paragraphs` with 153 rows, 0 exceptions.\n"
     ]
    }
   ],
   "source": [
    "pxt.drop_table('pdf_paragraphs', ignore_errors=True)\n",
    "pxt.drop_table('pdf_table', ignore_errors=True)\n",
    "\n",
    "pdf_table = pxt.create_table('pdf_table', { 'document' : pxt.DocumentType() })\n",
    "\n",
    "pdf_table.insert([{'document':pdf_path}])\n",
    "paragraph_table = cl.create_view(\n",
    "    'pdf_paragraphs',\n",
    "    pdf_table,\n",
    "    iterator=DocumentSplitter(document=pdf_table.document, separators='paragraph', metadata='page,bounding_box')\n",
    ")"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 14,
   "metadata": {
    "ExecuteTime": {
     "end_time": "2024-04-11T20:58:43.165541Z",
     "start_time": "2024-04-11T20:58:43.145501Z"
    }
   },
   "outputs": [
    {
     "data": {
      "text/html": [
       "<table border=\"1\" class=\"dataframe\">\n",
       "  <thead>\n",
       "    <tr style=\"text-align: right;\">\n",
       "      <th>pos</th>\n",
       "      <th>text</th>\n",
       "      <th>page</th>\n",
       "      <th>bounding_box</th>\n",
       "      <th>document</th>\n",
       "    </tr>\n",
       "  </thead>\n",
       "  <tbody>\n",
       "    <tr>\n",
       "      <td>0</td>\n",
       "      <td>LayoutParser: A Unified Toolkit for Deep\\nLearning Based Document Image Analysis\\n</td>\n",
       "      <td>0</td>\n",
       "      <td>{'x1': 157.6219940185547, 'x2': 457.8017883300781, 'y1': 115.03832244873047, 'y2': 147.33184814453125}</td>\n",
       "      <td>/Users/orm/repos/pixeltable/pixeltable/tests/data/documents/layout-parser-paper.pdf</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <td>1</td>\n",
       "      <td>Zejiang Shen1 (), Ruochen Zhang2, Melissa Dell3, Benjamin Charles Germain\\nLee4, Jacob Carlson3, and Weining Li5\\n</td>\n",
       "      <td>0</td>\n",
       "      <td>{'x1': 134.8090057373047, 'x2': 480.54638671875, 'y1': 167.27603149414062, 'y2': 192.8096160888672}</td>\n",
       "      <td>/Users/orm/repos/pixeltable/pixeltable/tests/data/documents/layout-parser-paper.pdf</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <td>2</td>\n",
       "      <td>1 Allen Institute for AI\\nshannons@allenai.org\\n2 Brown University\\nruochen zhang@brown.edu\\n3 Harvard University\\n{melissadell,jacob carlson}@fas.harvard.edu\\n4 University of Washington\\nbcgl@cs.washington.edu\\n5 University of Waterloo\\nw422li@uwaterloo.ca\\n</td>\n",
       "      <td>0</td>\n",
       "      <td>{'x1': 207.23001098632812, 'x2': 408.1268615722656, 'y1': 200.6651611328125, 'y2': 312.072998046875}</td>\n",
       "      <td>/Users/orm/repos/pixeltable/pixeltable/tests/data/documents/layout-parser-paper.pdf</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <td>3</td>\n",
       "      <td>Abstract. Recent advances in document image analysis (DIA) have been\\nprimarily driven by the application of neural networks. Ideally, research\\noutcomes could be easily deployed in production and extended for further\\ninvestigation. However, various factors like loosely organized codebases\\nand sophisticated model configurations complicate the easy reuse of im-\\nportant innovations by a wide audience. Though there have been on-going\\nefforts to improve reusability and simplify deep learning (DL) model\\ndevelopment in disciplines like natural language processing and computer\\nvision, none of them are optimized for challenges in the domain of DIA.\\nThis represents a major gap in the existing toolkit, as DIA is central to\\nacademic research across a wide range of disciplines in the social sciences\\nand humanities. This paper introduces LayoutParser, an open-source\\nlibrary for streamlining the usage of DL in DIA research and applica-\\ntions. The core LayoutParser library comes with a set of simple and\\nintuitive interfaces for applying and customizing DL models for layout de-\\ntection, character recognition, and many other document processing tasks.\\nTo promote extensibility, LayoutParser also incorporates a community\\nplatform for sharing both pre-trained models and full document digiti-\\nzation pipelines. We demonstrate that LayoutParser is helpful for both\\nlightweight and large-scale digitization pipelines in real-word use cases.\\nThe library is publicly available at https://layout-parser.github.io.\\n</td>\n",
       "      <td>0</td>\n",
       "      <td>{'x1': 162.7790069580078, 'x2': 454.092529296875, 'y1': 338.9521789550781, 'y2': 567.0989990234375}</td>\n",
       "      <td>/Users/orm/repos/pixeltable/pixeltable/tests/data/documents/layout-parser-paper.pdf</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <td>4</td>\n",
       "      <td>Keywords: Document Image Analysis · Deep Learning · Layout Analysis\\n· Character Recognition · Open Source library · Toolkit.\\n</td>\n",
       "      <td>0</td>\n",
       "      <td>{'x1': 162.3459930419922, 'x2': 452.2435302734375, 'y1': 577.9205322265625, 'y2': 600.168212890625}</td>\n",
       "      <td>/Users/orm/repos/pixeltable/pixeltable/tests/data/documents/layout-parser-paper.pdf</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <td>5</td>\n",
       "      <td>1\\nIntroduction\\n</td>\n",
       "      <td>0</td>\n",
       "      <td>{'x1': 134.7650146484375, 'x2': 228.99588012695312, 'y1': 619.8935546875, 'y2': 631.8607177734375}</td>\n",
       "      <td>/Users/orm/repos/pixeltable/pixeltable/tests/data/documents/layout-parser-paper.pdf</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <td>6</td>\n",
       "      <td>Deep Learning(DL)-based approaches are the state-of-the-art for a wide range of\\ndocument image analysis (DIA) tasks including document image classification [11,\\n</td>\n",
       "      <td>0</td>\n",
       "      <td>{'x1': 134.76499938964844, 'x2': 481.96844482421875, 'y1': 643.4950561523438, 'y2': 665.4126586914062}</td>\n",
       "      <td>/Users/orm/repos/pixeltable/pixeltable/tests/data/documents/layout-parser-paper.pdf</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <td>7</td>\n",
       "      <td>arXiv:2103.15348v2  [cs.CV]  21 Jun 2021\\n</td>\n",
       "      <td>0</td>\n",
       "      <td>{'x1': 10.940000534057617, 'x2': 37.619998931884766, 'y1': 213.3599853515625, 'y2': 560.0}</td>\n",
       "      <td>/Users/orm/repos/pixeltable/pixeltable/tests/data/documents/layout-parser-paper.pdf</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <td>8</td>\n",
       "      <td>2\\nZ. Shen et al.\\n</td>\n",
       "      <td>1</td>\n",
       "      <td>{'x1': 134.76499938964844, 'x2': 222.0977325439453, 'y1': 93.17021942138672, 'y2': 102.1366195678711}</td>\n",
       "      <td>/Users/orm/repos/pixeltable/pixeltable/tests/data/documents/layout-parser-paper.pdf</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <td>9</td>\n",
       "      <td>37], layout detection [38, 22], table detection [26], and scene text detection [4].\\nA generalized learning-based framework dramatically reduces the need for the\\nmanual specification of complicated rules, which is the status quo with traditional\\nmethods. DL has the potential to transform DIA pipelines and benefit a broad\\nspectrum of large-scale document digitization projects.\\nHowever, there are several practical difficulties for taking advantages of re-\\ncent advances in DL-based methods: 1) DL models are notoriously convoluted\\nfor reuse and extension. Existing models are developed using distinct frame-\\nworks like TensorFlow [1] or PyTorch [24], and the high-level parameters can\\nbe obfuscated by implementation details [8]. It can be a time-consuming and\\nfrustrating experience to debug, reproduce, and adapt existing models for DIA,\\nand many researchers who would benefit the most from using these methods lack\\nthe technical background to implement them from scratch. 2) Document images\\ncontain diverse and disparate patterns across domains, and customized training\\nis often required to achieve a desirable detection accuracy. Currently there is no\\nfull-fledged infrastructure for easily curating the target document image datasets\\nand fine-tuning or re-training the models. 3) DIA usually requires a sequence of\\nmodels and other processing to obtain the final outputs. Often research teams use\\nDL models and then perform further document analyses in separate processes,\\nand these pipelines are not documented in any central location (and often not\\ndocumented at all). This makes it difficult for research teams to learn about how\\nfull pipelines are implemented and leads them to invest significant resources in\\nreinventing the DIA wheel.\\nLayoutParser provides a unified toolkit to support DL-based document image\\nanalysis and processing. To address the aforementioned challenges, LayoutParser\\nis built with the following components:\\n</td>\n",
       "      <td>1</td>\n",
       "      <td>{'x1': 134.00100708007812, 'x2': 482.518798828125, 'y1': 118.3260269165039, 'y2': 427.1676330566406}</td>\n",
       "      <td>/Users/orm/repos/pixeltable/pixeltable/tests/data/documents/layout-parser-paper.pdf</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <td>10</td>\n",
       "      <td>1. An off-the-shelf toolkit for applying DL models for layout detection, character\\nrecognition, and other DIA tasks (Section 3)\\n</td>\n",
       "      <td>1</td>\n",
       "      <td>{'x1': 138.97097778320312, 'x2': 480.8236999511719, 'y1': 435.1130065917969, 'y2': 457.0306701660156}</td>\n",
       "      <td>/Users/orm/repos/pixeltable/pixeltable/tests/data/documents/layout-parser-paper.pdf</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <td>11</td>\n",
       "      <td>2. A rich repository of pre-trained neural network models (Model Zoo) that\\nunderlies the off-the-shelf usage\\n</td>\n",
       "      <td>1</td>\n",
       "      <td>{'x1': 138.97100830078125, 'x2': 480.89447021484375, 'y1': 458.6190490722656, 'y2': 480.5366516113281}</td>\n",
       "      <td>/Users/orm/repos/pixeltable/pixeltable/tests/data/documents/layout-parser-paper.pdf</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <td>12</td>\n",
       "      <td>3. Comprehensive tools for efficient document image data annotation and model\\ntuning to support different levels of customization\\n</td>\n",
       "      <td>1</td>\n",
       "      <td>{'x1': 138.97100830078125, 'x2': 480.5992126464844, 'y1': 482.12603759765625, 'y2': 504.0436706542969}</td>\n",
       "      <td>/Users/orm/repos/pixeltable/pixeltable/tests/data/documents/layout-parser-paper.pdf</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <td>13</td>\n",
       "      <td>4. A DL model hub and community platform for the easy sharing, distribu-\\ntion, and discussion of DIA models and pipelines, to promote reusability,\\nreproducibility, and extensibility (Section 4)\\n</td>\n",
       "      <td>1</td>\n",
       "      <td>{'x1': 138.97100830078125, 'x2': 482.3170471191406, 'y1': 505.6330261230469, 'y2': 539.5056762695312}</td>\n",
       "      <td>/Users/orm/repos/pixeltable/pixeltable/tests/data/documents/layout-parser-paper.pdf</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <td>14</td>\n",
       "      <td>The library implements simple and intuitive Python APIs without sacrificing\\ngeneralizability and versatility, and can be easily installed via pip. Its convenient\\nfunctions for handling document image data can be seamlessly integrated with\\nexisting DIA pipelines. With detailed documentations and carefully curated\\ntutorials, we hope this tool will benefit a variety of end-users, and will lead to\\nadvances in applications in both industry and academic research.\\nLayoutParser is well aligned with recent efforts for improving DL model\\nreusability in other disciplines like natural language processing [8, 34] and com-\\nputer vision [35], but with a focus on unique challenges in DIA. We show\\nLayoutParser can be applied in sophisticated and large-scale digitization projects\\n</td>\n",
       "      <td>1</td>\n",
       "      <td>{'x1': 134.406005859375, 'x2': 482.25592041015625, 'y1': 547.8540649414062, 'y2': 665.4207153320312}</td>\n",
       "      <td>/Users/orm/repos/pixeltable/pixeltable/tests/data/documents/layout-parser-paper.pdf</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <td>15</td>\n",
       "      <td>LayoutParser: A Unified Toolkit for DL-Based DIA\\n3\\n</td>\n",
       "      <td>2</td>\n",
       "      <td>{'x1': 237.13600158691406, 'x2': 480.6082763671875, 'y1': 93.17021942138672, 'y2': 102.13903045654297}</td>\n",
       "      <td>/Users/orm/repos/pixeltable/pixeltable/tests/data/documents/layout-parser-paper.pdf</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <td>16</td>\n",
       "      <td>that require precision, efficiency, and robustness, as well as simple and light-\\nweight document processing tasks focusing on efficacy and flexibility (Section 5).\\nLayoutParser is being actively maintained, and support for more deep learning\\nmodels and novel methods in text-based layout analysis methods [37, 34] is\\nplanned.\\nThe rest of the paper is organized as follows. Section 2 provides an overview\\nof related work. The core LayoutParser library, DL Model Zoo, and customized\\nmodel training are described in Section 3, and the DL model hub and commu-\\nnity platform are detailed in Section 4. Section 5 shows two examples of how\\nLayoutParser can be used in practical DIA projects, and Section 6 concludes.\\n</td>\n",
       "      <td>2</td>\n",
       "      <td>{'x1': 134.406005859375, 'x2': 482.5365295410156, 'y1': 118.3260269165039, 'y2': 236.00668334960938}</td>\n",
       "      <td>/Users/orm/repos/pixeltable/pixeltable/tests/data/documents/layout-parser-paper.pdf</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <td>17</td>\n",
       "      <td>2\\nRelated Work\\n</td>\n",
       "      <td>2</td>\n",
       "      <td>{'x1': 134.7650146484375, 'x2': 236.80259704589844, 'y1': 256.9905700683594, 'y2': 268.9577331542969}</td>\n",
       "      <td>/Users/orm/repos/pixeltable/pixeltable/tests/data/documents/layout-parser-paper.pdf</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <td>36</td>\n",
       "      <td>LayoutParser: A Unified Toolkit for DL-Based DIA\\n5\\n</td>\n",
       "      <td>4</td>\n",
       "      <td>{'x1': 237.13600158691406, 'x2': 480.6082763671875, 'y1': 93.17021942138672, 'y2': 102.13903045654297}</td>\n",
       "      <td>/Users/orm/repos/pixeltable/pixeltable/tests/data/documents/layout-parser-paper.pdf</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <td>18</td>\n",
       "      <td>Recently, various DL models and datasets have been developed for layout analysis\\ntasks. The dhSegment [22] utilizes fully convolutional networks [20] for segmen-\\ntation tasks on historical documents. Object detection-based methods like Faster\\nR-CNN [28] and Mask R-CNN [12] are used for identifying document elements [38]\\nand detecting tables [30, 26]. Most recently, Graph Neural Networks [29] have also\\nbeen used in table detection [27]. However, these models are usually implemented\\nindividually and there is no unified framework to load and use such models.\\nThere has been a surge of interest in creating open-source tools for document\\nimage processing: a search of document image analysis in Github leads to 5M\\nrelevant code pieces 6; yet most of them rely on traditional rule-based methods\\nor provide limited functionalities. The closest prior research to our work is the\\nOCR-D project7, which also tries to build a complete toolkit for DIA. However,\\nsimilar to the platform developed by Neudecker et al. [21], it is designed for\\nanalyzing historical documents, and provides no supports for recent DL models.\\nThe DocumentLayoutAnalysis project8 focuses on processing born-digital PDF\\ndocuments via analyzing the stored PDF data. Repositories like DeepLayout9\\n</td>\n",
       "      <td>2</td>\n",
       "      <td>{'x1': 134.406005859375, 'x2': 482.5574951171875, 'y1': 282.9630432128906, 'y2': 472.37469482421875}</td>\n",
       "      <td>/Users/orm/repos/pixeltable/pixeltable/tests/data/documents/layout-parser-paper.pdf</td>\n",
       "    </tr>\n",
       "  </tbody>\n",
       "</table>"
      ],
      "text/plain": [
       "    pos                                               text  page  \\\n",
       "0     0  LayoutParser: A Unified Toolkit for Deep\\nLear...     0   \n",
       "1     1  Zejiang Shen1 (), Ruochen Zhang2, Melissa Dell...     0   \n",
       "2     2  1 Allen Institute for AI\\nshannons@allenai.org...     0   \n",
       "3     3  Abstract. Recent advances in document image an...     0   \n",
       "4     4  Keywords: Document Image Analysis · Deep Learn...     0   \n",
       "5     5                                  1\\nIntroduction\\n     0   \n",
       "6     6  Deep Learning(DL)-based approaches are the sta...     0   \n",
       "7     7         arXiv:2103.15348v2  [cs.CV]  21 Jun 2021\\n     0   \n",
       "8     8                                2\\nZ. Shen et al.\\n     1   \n",
       "9     9  37], layout detection [38, 22], table detectio...     1   \n",
       "10   10  1. An off-the-shelf toolkit for applying DL mo...     1   \n",
       "11   11  2. A rich repository of pre-trained neural net...     1   \n",
       "12   12  3. Comprehensive tools for efficient document ...     1   \n",
       "13   13  4. A DL model hub and community platform for t...     1   \n",
       "14   14  The library implements simple and intuitive Py...     1   \n",
       "15   15  LayoutParser: A Unified Toolkit for DL-Based D...     2   \n",
       "16   16  that require precision, efficiency, and robust...     2   \n",
       "17   17                                  2\\nRelated Work\\n     2   \n",
       "18   36  LayoutParser: A Unified Toolkit for DL-Based D...     4   \n",
       "19   18  Recently, various DL models and datasets have ...     2   \n",
       "\n",
       "                                         bounding_box  \\\n",
       "0   {'x1': 157.6219940185547, 'x2': 457.8017883300...   \n",
       "1   {'x1': 134.8090057373047, 'x2': 480.5463867187...   \n",
       "2   {'x1': 207.23001098632812, 'x2': 408.126861572...   \n",
       "3   {'x1': 162.7790069580078, 'x2': 454.0925292968...   \n",
       "4   {'x1': 162.3459930419922, 'x2': 452.2435302734...   \n",
       "5   {'x1': 134.7650146484375, 'x2': 228.9958801269...   \n",
       "6   {'x1': 134.76499938964844, 'x2': 481.968444824...   \n",
       "7   {'x1': 10.940000534057617, 'x2': 37.6199989318...   \n",
       "8   {'x1': 134.76499938964844, 'x2': 222.097732543...   \n",
       "9   {'x1': 134.00100708007812, 'x2': 482.518798828...   \n",
       "10  {'x1': 138.97097778320312, 'x2': 480.823699951...   \n",
       "11  {'x1': 138.97100830078125, 'x2': 480.894470214...   \n",
       "12  {'x1': 138.97100830078125, 'x2': 480.599212646...   \n",
       "13  {'x1': 138.97100830078125, 'x2': 482.317047119...   \n",
       "14  {'x1': 134.406005859375, 'x2': 482.25592041015...   \n",
       "15  {'x1': 237.13600158691406, 'x2': 480.608276367...   \n",
       "16  {'x1': 134.406005859375, 'x2': 482.53652954101...   \n",
       "17  {'x1': 134.7650146484375, 'x2': 236.8025970458...   \n",
       "18  {'x1': 237.13600158691406, 'x2': 480.608276367...   \n",
       "19  {'x1': 134.406005859375, 'x2': 482.55749511718...   \n",
       "\n",
       "                                             document  \n",
       "0   /Users/orm/repos/pixeltable/pixeltable/tests/d...  \n",
       "1   /Users/orm/repos/pixeltable/pixeltable/tests/d...  \n",
       "2   /Users/orm/repos/pixeltable/pixeltable/tests/d...  \n",
       "3   /Users/orm/repos/pixeltable/pixeltable/tests/d...  \n",
       "4   /Users/orm/repos/pixeltable/pixeltable/tests/d...  \n",
       "5   /Users/orm/repos/pixeltable/pixeltable/tests/d...  \n",
       "6   /Users/orm/repos/pixeltable/pixeltable/tests/d...  \n",
       "7   /Users/orm/repos/pixeltable/pixeltable/tests/d...  \n",
       "8   /Users/orm/repos/pixeltable/pixeltable/tests/d...  \n",
       "9   /Users/orm/repos/pixeltable/pixeltable/tests/d...  \n",
       "10  /Users/orm/repos/pixeltable/pixeltable/tests/d...  \n",
       "11  /Users/orm/repos/pixeltable/pixeltable/tests/d...  \n",
       "12  /Users/orm/repos/pixeltable/pixeltable/tests/d...  \n",
       "13  /Users/orm/repos/pixeltable/pixeltable/tests/d...  \n",
       "14  /Users/orm/repos/pixeltable/pixeltable/tests/d...  \n",
       "15  /Users/orm/repos/pixeltable/pixeltable/tests/d...  \n",
       "16  /Users/orm/repos/pixeltable/pixeltable/tests/d...  \n",
       "17  /Users/orm/repos/pixeltable/pixeltable/tests/d...  \n",
       "18  /Users/orm/repos/pixeltable/pixeltable/tests/d...  \n",
       "19  /Users/orm/repos/pixeltable/pixeltable/tests/d...  "
      ]
     },
     "execution_count": 14,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "paragraph_table.show()"
   ]
  }
 ],
 "metadata": {
  "kernelspec": {
   "display_name": "Python 3 (ipykernel)",
   "language": "python",
   "name": "python3"
  },
  "language_info": {
   "codemirror_mode": {
    "name": "ipython",
    "version": 3
   },
   "file_extension": ".py",
   "mimetype": "text/x-python",
   "name": "python",
   "nbconvert_exporter": "python",
   "pygments_lexer": "ipython3",
   "version": "3.9.19"
  }
 },
 "nbformat": 4,
 "nbformat_minor": 4
}
